Repository navigation
feat(credentials): add an explicit ambient auth type for AWS Secrets Manager - #3486
Conversation
PR validation —
|
| Status | Policy | Material | Messages |
|---|---|---|---|
pr-min-approvals |
pr-info |
|
|
| ✅ Passed | pr-description-required |
pr-info |
- |
| ✅ Passed | pr-user-story-linked |
pr-info |
- |
AI Session Checks — ⚠️ no AI session found
Missing AI Coding Sessions
This organization requires every PR to be backed by a Chainloop Trace AI coding session, and none was found for this one.
Please make sure the AI coding session evidence has been sent by the Chainloop CLI, or add the skip-ai-session label to this PR to bypass this check.
Learn more about Chainloop Trace.
Security Checks — ✅ 7 passing
✅ AI Security Analysis
Reviewed this change against the project's security context (2 concerns hunted) — no introduced risk found.
View in Chainloop ↗ · How this works ↗
✅ secret-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ sast-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ iac-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scans not applied (2)
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="pkg/credentials/api/credentials/v1/config.proto">
<violation number="1" location="pkg/credentials/api/credentials/v1/config.proto:41">
P2: Removing `required` from `creds` changes the accepted config shape for every consumer of this descriptor. `config.pb.go` shares this proto between control-plane and CAS, so a chart/config that omits creds (the new keyless path) will cause any component still running the pre-PR binary to fail boot validation with a `creds is required` error during a staggered rollout. Confirm control-plane, CAS, and the chart ship together, or note the version-skew constraint in the release notes/chart.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
48f20ae to
a2c3193
Compare
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
Thank you for this contribution. Before we can merge it, please fix these items:
Tests fail when
|
bb3e414 to
03a9e64
Compare
|
One open question on Ambient credentials resolve lazily, so I can add either of these to this PR:
My preference is option 1. Or I can leave it as it is and handle it separately. |
|
Thanks for the contribution, I'll leave it to @jiparis to provide input to your commment, thanks! |
…Manager AWSSecretManager gains an auth_type enum. AUTH_TYPE_AMBIENT resolves credentials through the AWS SDK default chain (EKS Pod Identity, IRSA, instance role), so the control plane and CAS need no stored keys. AUTH_TYPE_CREDENTIALS keeps the static keys, and AUTH_TYPE_UNSPECIFIED is treated as AUTH_TYPE_CREDENTIALS, so existing configurations do not change. The operator must select ambient authentication explicitly. NewManager rejects AUTH_TYPE_CREDENTIALS without both keys, so forgotten keys fail at startup instead of silently using whatever the default chain finds, and rejects AUTH_TYPE_AMBIENT with either key set. The chart exposes secretsBackend.awsSecretManager.authType and renders the creds block only for AUTH_TYPE_CREDENTIALS. The tests isolate the default chain from the host (AWS config files, AWS_PROFILE, IMDS). Assisted-by: Claude Code Signed-off-by: Khris Richardson <khris.richardson@gmail.com>
03a9e64 to
0833f4b
Compare
|
Thanks. Rebased on main. Commits are signed and carry One question from Oct 1 is still open: should ambient log its credential source at startup (option 1), fail at startup (option 2), or neither? Happy to add whichever you prefer here. Checks run locally (container golang:1.27.3; chainloop main d4fc985 vs this branch): CI: the Actions workflows (Test, Lint, CodeQL) have never run on this PR. As a first-time contributor's fork PR they waited for approval and expired after 30 days. Could a maintainer approve the runs after this push? The integration tests (testcontainers: Vault, AWS, the credentials manager) only run there; we ran everything else locally. |
Part of #3488.
The AWS Secrets Manager backend required a static access key and secret, and deliberately bypassed the SDK's default
credential chain. That rules out the keyless options EKS offers (Pod Identity, IRSA), which is what most operators on
EKS want: no long-lived key stored anywhere.
AWSSecretManagergains anauth_typeenum, as requested in review:AUTH_TYPE_CREDENTIALS(andAUTH_TYPE_UNSPECIFIED, so existing configurations do not change): only the statickeys are used, and ambient credentials are never consulted. This keeps the guarantee fix(aws): do not load creds from env vars #2509 established. Missing
either key is an error, so forgotten keys fail at startup instead of falling through to the node's instance role.
AUTH_TYPE_AMBIENT: the region is loaded throughconfig.LoadDefaultConfig, which resolves Pod Identity, IRSA'sweb identity token, or an instance role. Setting either key is an error.
defined_only), and byNewManager.Chart:
secretsBackend.awsSecretManager.authType(defaultAUTH_TYPE_CREDENTIALS). Thecredsblock renders only forAUTH_TYPE_CREDENTIALS. Keys set withAUTH_TYPE_AMBIENT, or an unknownauthType, fail at template time. Chartversion bumped to 1.493.1.
Tests: the
awsandmanagertests isolate the default chain from the host (empty AWS config files,AWS_PROFILEunset, IMDS disabled).
TestNewFromConfignow passes withAWS_PROFILEset; without the isolation it fails with thefailed to get shared config profileerror from review.Upgrade note: a config with
AUTH_TYPE_AMBIENTand nocredsis rejected by an older binary (credswas required).The chart ships the control plane and CAS together, so a chart upgrade moves both at once.
AI assistance: this PR was written with the help of Claude Code. Each commit carries an
Assisted-by: Claude Codetrailer.